//
//  MainGame.h
//  KRoll
//
//  Created by VIETHUNG on 3/13/14.
//
//

#ifndef __KRoll__MainGame__
#define __KRoll__MainGame__

#include "cocos2d.h"
#include "CCParallaxNodeExtras.h"
#include "Background.h"

typedef enum
{
    kGameStart,
    kGamePause,
    kGameOver
} GameStatus;

class MainGame : public Background
{
    
protected:
    cocos2d::CCPoint bird_pos;
	cocos2d::ccVertex2F bird_vel;
    
    
private:
    cocos2d::CCSize sizeVisi;
    cocos2d::CCSize sizeScreen;
    
    GameStatus gameStatus;
    
    void gameStart();
    void gameOver();
    
    // add scene
    void addBackGround();
    void addCloud();
    void addBlock();
    
    void tutorial();
    void playGame();
    
    float pointMove;
    float border;
    int score;
    bool isPlay;
    
    CCParallaxNodeExtras *_parallaxNode;
    
    virtual void onEnter();
    virtual void onExit();
    
    CCLabelTTF *labelScore;   
    CCLabelTTF *lblPlay;
    
public:
    
    ~MainGame();
    
    virtual bool init();
    
    static cocos2d::CCScene* scene();
    
    // a selector callback
    void menuCloseCallback(CCObject* pSender);
    
    virtual void update(float dt);
    
    CREATE_FUNC(MainGame);
    
    virtual void didAccelerate(cocos2d::CCAcceleration* pAccelerationValue);
    virtual bool ccTouchBegan(cocos2d::CCTouch* touch, cocos2d::CCEvent* event);
};

#endif /* defined(__KRoll__MainGame__) */
